pub fn new_birthday_probability(n: u32) -> f64 {
    if n >= 365 {
        return 0.0;
    }
    1.0 - possi(n)
}

/// N个人中不存在有几人生日相同的概率
fn possi(n: u32) -> f64 {
    assert!(n < 365);
    let mut res = 1.0;
    let mut left_365_divider = n;
    for mul_item in (365 - n + 1)..=365 {
        res *= mul_item as f64;
        while left_365_divider > 0 && res >= 365.0 {
            res /= 365.0;
            left_365_divider -= 1;
        }
    }
    while left_365_divider > 0 {
        res /= 365.0;
        left_365_divider -= 1;
    }
    res
}
